//
//  LargeGoodsCell.m
//  WorkNest
//
//  Created by qbm360 on 15/7/30.
//  Copyright (c) 2015年 nest. All rights reserved.
//

#import "LargeGoodsCell.h"
#import "OrderPayViewController.h"

@interface LargeGoodsCell ()

@property (weak, nonatomic) IBOutlet UIImageView *image;
@property (weak, nonatomic) IBOutlet UILabel *name;
@property (weak, nonatomic) IBOutlet UILabel *count;
@property (weak, nonatomic) IBOutlet UILabel *price;
@property (weak, nonatomic) IBOutlet UILabel *date;
@property (weak, nonatomic) IBOutlet UIButton *payButton;
@property (weak, nonatomic) IBOutlet UILabel *orderId;

@end

@implementation LargeGoodsCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setIfWaittingPay:(BOOL)ifWaittingPay {
    _ifWaittingPay = ifWaittingPay;
    self.payButton.hidden = !_ifWaittingPay;
}

- (IBAction)goToPayButton:(id)sender {
    if (_largeGoodsBlock) {
        _largeGoodsBlock();
    }
}

- (void)setBulkorderModel:(BulkorderModel *)bulkorderModel {
    _bulkorderModel = bulkorderModel;
    [self.image setImageWithURL:[NSURL URLWithString:[UIUtil containString:_bulkorderModel.mainImage]] placeholderImage:[UIImage imageNamed:@"tupian"]];
    self.name.text = _bulkorderModel.productName;
    self.count.text = [NSString stringWithFormat:@"%@件",_bulkorderModel.totalQuantity];;
    self.price.text = [NSString stringWithFormat:@"￥%@", _bulkorderModel.totalPrice];
    self.date.text = [_bulkorderModel.orderTime substringToIndex:10];
    self.orderId.text = [NSString stringWithFormat:@"订单号:%@",_bulkorderModel.bulkOrderId];
}

@end
